package com.spring.pick2pick.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import com.spring.pick2pick.model.SportItem;

/** 종목의 기능을 처리하는 Dao */
@Repository
public class SportDao {
	
	@Autowired
	private SqlMapClientTemplate sqlMapClientTemplate;
	
	public int getSportCount() {
		return (Integer) sqlMapClientTemplate.queryForObject("sport.getSportCount");
	}
	
	/** 종목 리스트 기능 */
	@SuppressWarnings("unchecked")
	public List<SportItem> getSportList(String order) {
		return sqlMapClientTemplate.queryForList("sport.getSportList", order);
	}
	
}
